package com.yss.system.api;

import com.yss.common.core.constant.SecurityConstants;
import com.yss.common.core.constant.ServiceNameConstants;
import com.yss.common.core.domain.YssResponse;
import com.yss.system.api.domain.SysRole;
import com.yss.system.api.domain.SysUser;
import com.yss.system.api.factory.RemoteDeptFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 部门服务 获取一个部门的下级部门
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDeptFallbackFactory.class)
public interface RemoteDeptService {

    @PostMapping("/dept/getUserDeptIds")
    public YssResponse<List<String>> getUserDeptIds(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/dept/getRoleDeptIds")
    public YssResponse<List<String>> getRoleDeptIds(@RequestBody SysRole sysRole, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
